﻿using LINGYUN.Abp.WeChat.MiniProgram;
using Microsoft.Extensions.DependencyInjection;
using Volo.Abp.Modularity;

namespace LINGYUN.Abp.Notifications.WeChat.MiniProgram;

[DependsOn(
    typeof(AbpWeChatMiniProgramModule), 
    typeof(AbpNotificationsModule))]
public class AbpNotificationsWeChatMiniProgramModule : AbpModule
{
    public override void ConfigureServices(ServiceConfigurationContext context)
    {
        var preActions = context.Services.GetPreConfigureActions<AbpNotificationsWeChatMiniProgramOptions>();

        Configure<AbpNotificationsWeChatMiniProgramOptions>(options =>
        {
            preActions.Configure(options);
        });

        Configure<AbpNotificationsPublishOptions>(options =>
        {
            options.PublishProviders.Add<WeChatMiniProgramNotificationPublishProvider>();
        });
    }
}
